<template>
  
   <div >
      <!-- <Alert type="warning" msg="测试一下!!!" /> -->
       
       <Login   />
      <NewTopic   type="topic" v-bind:addTagBox="true"   />
 
      <Nuxt />
       <div  id="alertBox"  >
         
       </div>
       <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());

        gtag('config', 'G-2K8WK8VFHJ');
      </script>
   </div>
</template>

<script>
// 点击菜单的时候,侧边宽度为w-60  pl-60 所以右侧内容div 为  pl-60 , 默认w-20  pl-20  
export default {
  created(){
    //console.log("layout created",this.$store);
    this.getUserInfo();
  },
   methods: {
     async getUserInfo(){
        if(this.$store.state.user.uid>0){
          return;
        }
        let res = await  this.$axios.get("snogogo_nuxt/api/userinfo");
        if(res.code>0){
          this.$tools.alert("error",res.code+":"+res.msg);
          return;
        }
        //console.log("userinfo:",res.data)
        if(res.data && res.data.uid){
          this.$store.commit("SET_USER",res.data)
        }
     }
     
  },
  head() {
    return {
      title: 'SnoGoGo Community - A community dedicated to all Snowboarding & skiing enthusiasts',
      meta: [
        
        
       
      ],
      link: [
       
        {
          rel: 'stylesheet',
          href: '/css/style.css',
        },
      ],
      script: [
         {
          src: 'https://www.googletagmanager.com/gtag/js?id=G-2K8WK8VFHJ',
          ssr: true,
        } 
      ],
    };
  }
  
  
};
</script>
